<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    function isType (type) {
      // console.log('type:',type);
      return function (obj) {
        console.log('obj:' + obj)
        console.log('type:',type);
        return Object.prototype.toString.call(obj).includes(type)
      }
    }
    let types = ['String', 'Null', 'Undefined', 'Boolean', 'Object', 'Symbol', 'BigInt', 'Number', 'Array']
    let fn = {}
    types.forEach(type => {
      fn['is' + type] = isType(type)
    })
    console.log('fn:',fn);

    let a = 343
    console.log(fn.isNumber(a))
  </script>
  <script>
    // Object.prototype.toString.call(true).includes()
  </script>
</body>

</html>